
<?php
// $Id: results.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
global $base_url,$language;
  $url = $base_url . '/' . drupal_get_path('module', 'whatsnew');
//echo_r($language);
echo "<pre>";print_r($items); echo"</pre>";
 // echo $nid->nid;
if($language->language=='ta'){
	$lang= '/ta';
}else{
 $lang='';
}
?>	
<div class="whatsnew_container">

					<div id='innerResHead'><?php $docheader;$nums= pg_num_rows($items); 
                                        if(!empty($year)){
    $month_array = array('Jan'=>'01','Feb'=>'02','Mar'=>'03','Apr'=>'04','May'=>'05','Jun'=>'06','July'=>'07','Aug'=>'08','Sep'=>'09','Oct'=>'10','Nov'=>'11','Dec'=>'12',);                                    
$month_exp = '';
foreach ($month_array as $key => $value){
    if(!empty($month)){
        $month = (int) $month;
 $month_exp = date( 'F', mktime(0, 0, 0, $month) );
 }
   $OPmonth .= l($key,"whatsnew/archives/".$year."/".$value)."&nbsp;&nbsp;";
}
echo '<div style="padding-left:10px"><div style="height:10px">&nbsp;&nbsp;</div>';
echo '<div style="font-weight:bold">Archives: <span style="color:red;">'.$year.'&nbsp;&nbsp;'.t($month_exp).'</span></div>';
echo '<div>'.$OPmonth.'</div></div>';

                                            
                                        }
                                        if(!empty($nums)) { ?>

							<div class='w_date'>Date</div>
							<div class='w_title'>Title</div>
							<div class='clr'></div>			
					</div>

	<?php 
	global $base_url;
	//$baseurl=str_replace('tnportal_demo','tncms',$base_url);
	$baseurl=BASECH;
        
		while ($whatsnewlist = db_fetch_object($items)){
	//	print "<pre>"; print_r($whatsnewlist); print "</pre>";		
		
 
        if($whatsnewlist->field_whatsnew_available_value == 'download')  
            $filepath = $baseurl.$whatsnewlist->filepath; 
        elseif($whatsnewlist->field_whatsnew_available_value == 'offline')  
            $filepath = $whatsnewlist->field_whatsnew_offline_value; 
        elseif($whatsnewlist->field_whatsnew_available_value == 'online')  
            $filepath = $whatsnewlist->field_whatsnew_url_value;
	
		
		
		$date = date ('F j,Y',strtotime($whatsnewlist->field_whatsnew_date_value) );
		$title = $whatsnewlist-> title;
               if(date('F j,Y') == $date)
		$title = '<b>'.$whatsnewlist-> title.'</b>';
		$desc = $whatsnewlist->field_whatsnew_description_value;
		
	?>
	<div style='padding-top:3px; padding-bottom:3px;' id='w_res'>
	

<div style='float:left;' class='w_res_date'><?php echo     $date; ?></div> 
    <?php 
        if($whatsnewlist->field_whatsnew_available_value == 'offline') {    ?> 
<div style='float:left;' class='w_res_title'><a href='<?php echo $filepath; ?>'> 
        <?php echo $title; ?></a></div>     <?php         }        
		 else {    
		  //$filepath = str_replace('http://www.tn.gov.in','http://sp.tn.gov.in',$filepath);
		   ?> 
        <div style='float:left;' class='w_res_title'><a href='javascript:void(0);' onclick='return tnportal_ext_window("<?php echo $filepath;?>");'> 
        <?php echo $title; ?></a></div>     <?php         }     ?>     
                 
        <div class='clr'></div>
	</div> 
		
	<div style='height:3px;'></div>
	<?php		 } ?>
		 
		 
	<div class='clr'></div>
<?php 
echo theme_pager(); 
}
else {
  
    ?>
        </div>
        <?php
        RecordnotFound_doc();
}
?>	
</div>